package com.huike.web.controller.itheima.easyexcel;

import com.alibaba.excel.EasyExcel;
import com.huike.clues.domain.vo.TbClueExcelVo;
import com.huike.web.controller.itheima.listener.EasyExcelListener;


import java.io.*;

import java.util.List;

public class EasyExcelTest2 {
    public static void main(String[] args) throws FileNotFoundException {
        System.out.println("===读文件===");
        //待解析的文件路径
        String filePath1 =
                "E:\\迅雷下载\\黑马\\资料\\58期共享\\CRM项目实战day05\\" +
                        "CRM项目实战day05\\线索数据\\2100clues.xlsx";
        File file = new File(filePath1);
        FileInputStream inputStream = new FileInputStream(file);
        EasyExcelListener easyExcelListener = new EasyExcelListener();
        EasyExcel.read(inputStream, TbClueExcelVo.class, easyExcelListener).
                sheet().doRead();
        List<TbClueExcelVo> connectors = easyExcelListener.getDatas();
        for (TbClueExcelVo connector : connectors) {
            System.out.println(connector);
        }
    }
}
